<html>
<head><meta charset="utf-8"><title>rustc_args_required_const in traits · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html">rustc_args_required_const in traits</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="166522197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166522197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166522197">(May 25 2019 at 10:56)</a>:</h4>
<p>I'm trying to implement an intrinsic that takes a literal value as argument:</p>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="k">impl</span><span class="w"> </span><span class="n">VectorCtf</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">vector_signed_int</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">type</span> <span class="nb">Result</span> <span class="o">=</span><span class="w"> </span><span class="n">vector_float</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="cp">#[inline]</span><span class="w"></span>
<span class="w">        </span><span class="cp">#[target_feature(enable = </span><span class="s">&quot;altivec&quot;</span><span class="cp">)]</span><span class="w"></span>
<span class="w">        </span><span class="cp">#[rustc_args_required_const(1)]</span><span class="w"></span>
<span class="w">        </span><span class="k">unsafe</span><span class="w"> </span><span class="k">fn</span> <span class="nf">vec_ctf</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">b</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Self</span>::<span class="nb">Result</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">vec_vcfsx</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>This leads to:</p>
<div class="codehilite"><pre><span></span>error: argument 2 is required to be a constant
   --&gt; crates/core_arch/src/powerpc/altivec.rs:447:13
    |
447 |             vec_vcfsx(self, b)
    |             ^^^^^^^^^^^^^^^^^^
</pre></div>


<p>Am I doing something silly or there is a limitation to be addressed in rustc?</p>



<a name="166522387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166522387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166522387">(May 25 2019 at 11:02)</a>:</h4>
<p>simpler testcase <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=930967e5ad01ef08697720805ed09062" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=930967e5ad01ef08697720805ed09062">here</a></p>



<a name="166522449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166522449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166522449">(May 25 2019 at 11:04)</a>:</h4>
<p>even calling function from function fails <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=f2a2a96e4d0019048c6661668a782088" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=f2a2a96e4d0019048c6661668a782088">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=f2a2a96e4d0019048c6661668a782088</a></p>



<a name="166531723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166531723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166531723">(May 25 2019 at 15:24)</a>:</h4>
<p>I don't think these were ever intended to be used this way. To be honest that feature is a total hack that I don't know how it ever got exposed to users without an RFC</p>



<a name="166531738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166531738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166531738">(May 25 2019 at 15:25)</a>:</h4>
<p>I don't think this will get addressed any time soon (if ever). Const generics should give us a much cleaner way to use these</p>



<a name="166531971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166531971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166531971">(May 25 2019 at 15:30)</a>:</h4>
<p>AFAIK, <code>rustc</code> attributes are generally expected to be used only inside rustc</p>



<a name="166531990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166531990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166531990">(May 25 2019 at 15:30)</a>:</h4>
<p>we can't stop you (on nightly) from using them yourself, but dont expect documentation, dont expect any kind of stability, and dont expect them to work for anything beyond what rustc needed them for</p>



<a name="166532712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166532712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166532712">(May 25 2019 at 15:50)</a>:</h4>
<p>If I understand it correctly the above is actually for "inside rustc" (isn't <code>core_arch</code> related to <code>core::arch</code>?)</p>



<a name="166532736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166532736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166532736">(May 25 2019 at 15:51)</a>:</h4>
<p>I want a time machine and just implement a crappy version of const generics (that can't handle being used in array lengths) and just allows the intrinsic use case</p>



<a name="166550430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166550430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166550430">(May 26 2019 at 00:29)</a>:</h4>
<blockquote>
<p>To be honest that feature is a total hack that I don't know how it ever got exposed to users without an RFC</p>
</blockquote>
<p>It was never approved by the language team; the libs team inappropriately approved it. That's how <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="166550437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166550437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166550437">(May 26 2019 at 00:29)</a>:</h4>
<p>I would have never approved it had I been on the language team at that point</p>



<a name="166550441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166550441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166550441">(May 26 2019 at 00:29)</a>:</h4>
<p>and yeah, it's a total hack; if we want to make a sane version out of it you'd need <code>fn foo(const N: usize)</code></p>



<a name="166550493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166550493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166550493">(May 26 2019 at 00:30)</a>:</h4>
<p>which is basically "const generics but not an implicit argument"</p>



<a name="166564350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166564350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166564350">(May 26 2019 at 07:53)</a>:</h4>
<p>oh, "exposed to users" not as in "users can use this attribute" but "users can use methods that have that attribute"... yeah that's sad :(</p>



<a name="166569277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166569277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166569277">(May 26 2019 at 10:29)</a>:</h4>
<p>well, the alternative is to have a first class literal-arg.</p>



<a name="166569323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166569323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166569323">(May 26 2019 at 10:30)</a>:</h4>
<p>And we need it to expose intrinsics</p>



<a name="166569337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166569337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166569337">(May 26 2019 at 10:31)</a>:</h4>
<p>(and yes it is used in what will be <code>core::arch::altivec</code> :P)</p>



<a name="166570077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166570077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166570077">(May 26 2019 at 10:52)</a>:</h4>
<p>what's the stabilization timeline on <code>core::arch::altivec</code>?</p>



<a name="166570087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166570087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166570087">(May 26 2019 at 10:53)</a>:</h4>
<p>like can this just wait on const generics?</p>



<a name="166571184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166571184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166571184">(May 26 2019 at 11:28)</a>:</h4>
<p>I can postpone those instructions</p>



<a name="166571186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166571186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166571186">(May 26 2019 at 11:28)</a>:</h4>
<p>what's the const generics timeline?</p>



<a name="166573126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166573126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166573126">(May 26 2019 at 12:31)</a>:</h4>
<p>From current events I'd guess this year?</p>



<a name="166697925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166697925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166697925">(May 28 2019 at 09:25)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="126931">@centril</span> this was required for x86 SIMD on stable, so... without this "hack", we couldn't have stabilized SIMD last year</p>



<a name="166697966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166697966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166697966">(May 28 2019 at 09:25)</a>:</h4>
<p>also const-generics wouldn't be enoug</p>



<a name="166697996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166697996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166697996">(May 28 2019 at 09:25)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> I'm not complaining about the feature, I'm complaining about the lack of a story of how to get rid of the hack and have an actual feature that users can use, too</p>



<a name="166698061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698061">(May 28 2019 at 09:26)</a>:</h4>
<blockquote>
<p>also const-generics wouldn't be enoug</p>
</blockquote>
<p>please elaborate!</p>



<a name="166698064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698064">(May 28 2019 at 09:26)</a>:</h4>
<p>the lang team was consulted, and the recommendation was to actually go with this attribute, because the features required only make sense designing after const-generics has been fully implemented and stabilized, so the timeline for what's required would be "maybe start thinking about more const generics feature after const generics is stable"</p>



<a name="166698083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698083">(May 28 2019 at 09:26)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> these would need const function arguments</p>



<a name="166698090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698090">(May 28 2019 at 09:26)</a>:</h4>
<p>I don't understand, what's the difference?</p>



<a name="166698125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698125">(May 28 2019 at 09:27)</a>:</h4>
<p>the same as between <code>impl Trait</code> in argument position and generics</p>



<a name="166698155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698155">(May 28 2019 at 09:27)</a>:</h4>
<p>e.g. you can't <code>foo::&lt;3&gt;()</code> for example</p>



<a name="166698178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698178">(May 28 2019 at 09:27)</a>:</h4>
<p>you can <code>foo::&lt;{3}&gt;()</code>, right?</p>



<a name="166698270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698270">(May 28 2019 at 09:28)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=587dde74a85e3762b9a03928e39d8547" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=587dde74a85e3762b9a03928e39d8547">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=587dde74a85e3762b9a03928e39d8547</a></p>



<a name="166698299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698299">(May 28 2019 at 09:29)</a>:</h4>
<p>jup, that works</p>



<a name="166698412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698412">(May 28 2019 at 09:30)</a>:</h4>
<p>oh, wait, now I understand</p>



<a name="166698434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698434">(May 28 2019 at 09:30)</a>:</h4>
<p>you mean if we get argument position const generics, we can't specify those in generic brackets?</p>



<a name="166698563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698563">(May 28 2019 at 09:32)</a>:</h4>
<p>I mean this all seems fairly reasonable, and I want it. But the lack of an RFC for a feature that is user visible and basically (due to backwards incompat rules) insta-stable forever, makes me uncomfortable.</p>



<a name="166698603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698603">(May 28 2019 at 09:33)</a>:</h4>
<p>I don't see any problem with the current feature, but extending it so the arguments appear as constants inside the function is dangerous</p>



<a name="166698690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698690">(May 28 2019 at 09:34)</a>:</h4>
<p>const generics is implemented far enough for an RFC to be written for argument position const generics, so I suggest to go down that route</p>



<a name="166698762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698762">(May 28 2019 at 09:35)</a>:</h4>
<p>i mean that we need <code>fn foo(x: const usize)</code> which AFAICT needs supports for existential const generics</p>



<a name="166698880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698880">(May 28 2019 at 09:36)</a>:</h4>
<p>the lang team argued _back then_ that it made little sense to design existential const types when const generics aren't even a thing</p>



<a name="166698999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166698999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166698999">(May 28 2019 at 09:38)</a>:</h4>
<p>if that changed, an RFC for that would be great</p>



<a name="166699058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699058">(May 28 2019 at 09:39)</a>:</h4>
<blockquote>
<p>I don't see any problem with the current feature, but extending it so the arguments appear as constants inside the function is dangerous</p>
</blockquote>
<p>I don't think anybody is requesting that. A user misunderstood what the feature should do, and filled an issue, but that has been clarified, and the issue can be closed.</p>



<a name="166699182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699182">(May 28 2019 at 09:40)</a>:</h4>
<blockquote>
<p>const generics is implemented far enough for an RFC to be written for argument position const generics, so I suggest to go down that route</p>
</blockquote>
<p>I suppose that an RFC for existential const types can be written now, e.g., exploring <code>fn foo(x: const usize);</code>, <code>fn bar() -&gt; const usize;</code>, etc. and proposing some feature that mixes well with the language</p>



<a name="166699216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699216">(May 28 2019 at 09:41)</a>:</h4>
<p>how would argument position constants be different from const generics?</p>



<a name="166699226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699226">(May 28 2019 at 09:41)</a>:</h4>
<p>arent's arguments universal (that's what I got from <code>impl Trait</code> at least)</p>



<a name="166699251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699251">(May 28 2019 at 09:42)</a>:</h4>
<p>I understand that return position constants are a different story, but that doesn't need to be solved right now</p>



<a name="166699299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699299">(May 28 2019 at 09:42)</a>:</h4>
<p>IIRC <code>impl Trait</code> is always an existential type, but in argument position it is isomorphic to a similar universally quantified type</p>



<a name="166699314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699314">(May 28 2019 at 09:42)</a>:</h4>
<p>ah, yea, that argument</p>



<a name="166699316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699316">(May 28 2019 at 09:42)</a>:</h4>
<p>i think <span class="user-mention" data-user-id="121053">@varkor</span> wrote something showing that</p>



<a name="166699320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699320">(May 28 2019 at 09:42)</a>:</h4>
<p>I don't like it :P</p>



<a name="166699332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699332">(May 28 2019 at 09:42)</a>:</h4>
<p>I held a presentation about that ;)</p>



<a name="166699363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699363">(May 28 2019 at 09:43)</a>:</h4>
<p>in any case, maybe now it is the time for that feature, but stable SIMD shipped in Februrary last year, and this attribute was added like 6 months before, so back then, this attribute was the best solution we had</p>



<a name="166699426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699426">(May 28 2019 at 09:44)</a>:</h4>
<p>it was also clear that this attribute should just error if an argument isn't const, and that's it. It was never intended to be "const generic arguments" or something like that, just something that allows us to change these APIs to use "const generic arguments" in a backward compatible way once those become available</p>



<a name="166699500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699500">(May 28 2019 at 09:45)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> i think I wrote an RFC about const generic arguments back then, you might want to scavenge it ;)</p>



<a name="166699509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699509">(May 28 2019 at 09:45)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> Still could use some documentation love in <a href="https://github.com/rust-lang/rust/blob/e70d5386d7abcf39adf54feb43a655c4f8a1bcb6/src/libsyntax/feature_gate.rs#L1465" target="_blank" title="https://github.com/rust-lang/rust/blob/e70d5386d7abcf39adf54feb43a655c4f8a1bcb6/src/libsyntax/feature_gate.rs#L1465">https://github.com/rust-lang/rust/blob/e70d5386d7abcf39adf54feb43a655c4f8a1bcb6/src/libsyntax/feature_gate.rs#L1465</a></p>



<a name="166699517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699517">(May 28 2019 at 09:45)</a>:</h4>
<p>all it says there is "will never be stable" :D</p>



<a name="166699602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699602">(May 28 2019 at 09:46)</a>:</h4>
<p>heh, I already have a const RFC open, one thing at a time</p>



<a name="166699637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699637">(May 28 2019 at 09:47)</a>:</h4>
<p>that should be enough for those that need to use it :P in this case it wasn't, so i'm sorry that <span class="user-mention" data-user-id="131070">@Luca Barbato</span> wasted time on this, but I don't know if a comment there would have helped much</p>



<a name="166699653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699653">(May 28 2019 at 09:47)</a>:</h4>
<p>we don't want to encourage anybody to use this, this is for libstd consumption only</p>



<a name="166699668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699668">(May 28 2019 at 09:47)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> i thought the const RFC was already merged ?</p>



<a name="166699693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699693">(May 28 2019 at 09:48)</a>:</h4>
<p>w/oboats one i mean</p>



<a name="166699748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699748">(May 28 2019 at 09:48)</a>:</h4>
<p>not sure which one you mean, but I'm talking about <a href="https://github.com/rust-lang/rfcs/pull/2632" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2632">https://github.com/rust-lang/rfcs/pull/2632</a></p>



<a name="166699927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699927">(May 28 2019 at 09:51)</a>:</h4>
<p>ah no, i meant this one: <a href="https://github.com/rust-lang/rfcs/pull/2000" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2000">https://github.com/rust-lang/rfcs/pull/2000</a></p>



<a name="166699933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699933">(May 28 2019 at 09:51)</a>:</h4>
<p>this has nothing to do with "existential consts"</p>



<a name="166699938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166699938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166699938">(May 28 2019 at 09:51)</a>:</h4>
<blockquote>
<p>we don't want to encourage anybody to use this, this is for libstd consumption only</p>
</blockquote>
<p>yea, sorry about overreacting. It's just not been an easy feature to work with when changing things in the compiler's const qualifier.</p>



<a name="166700018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700018">(May 28 2019 at 09:52)</a>:</h4>
<p>the only difference between <code>fn foo(const A: B)</code> and <code>fn foo&lt;const A: B&gt;()</code> is that the latter allows for value inference whereas the latter doesn't</p>



<a name="166700072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700072">(May 28 2019 at 09:53)</a>:</h4>
<p>is the <code>const B</code> in the first one part of the function generic parameters ?</p>



<a name="166700079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700079">(May 28 2019 at 09:53)</a>:</h4>
<p>to de-hack this we will therefore need to introduce <code>fn foo(const A: B)</code></p>



<a name="166700131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700131">(May 28 2019 at 09:54)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  I would suggest not thinking of this in terms of "generic parameters"</p>



<a name="166700139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700139">(May 28 2019 at 09:54)</a>:</h4>
<p>we have implicit arguments and explicit arguments</p>



<a name="166700144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700144">(May 28 2019 at 09:54)</a>:</h4>
<p>the things in <code>&lt;...&gt;</code> are implicit and the things in <code>(...)</code> are explicit</p>



<a name="166700167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700167">(May 28 2019 at 09:54)</a>:</h4>
<p>Would <code>fn foo&lt;const A: B&gt;(const A: B)</code>work ?</p>



<a name="166700208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700208">(May 28 2019 at 09:55)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  that would be like saying <code>fn foo(x: u8, x: u8)</code></p>



<a name="166700227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700227">(May 28 2019 at 09:55)</a>:</h4>
<p>i.e. you are introducing <code>A</code> twice</p>



<a name="166700285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700285">(May 28 2019 at 09:56)</a>:</h4>
<p>Maybe <code>fn foo&lt;const A: usize&gt;(x: A)</code></p>



<a name="166700320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700320">(May 28 2019 at 09:56)</a>:</h4>
<p><code>A</code> is not a type so <code>x: A</code> is not well-formed</p>



<a name="166700389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700389">(May 28 2019 at 09:57)</a>:</h4>
<p>The smart thing to do here would have been to introduce <code>fn foo&lt;const A: B&gt;()</code>  for these arguments but not put in place the inference</p>



<a name="166700391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700391">(May 28 2019 at 09:57)</a>:</h4>
<p>so one has to pick between <code>fn foo&lt;const A: usize&gt;(); foo::&lt;3&gt;()</code>, and <code>fn foo(const x: usize); foo(3)</code>, but <code>foo::&lt;3&gt;(3);</code> is never a thing</p>



<a name="166700398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700398">(May 28 2019 at 09:57)</a>:</h4>
<p>so that you have to specify as <code>foo::&lt;3&gt;()</code></p>



<a name="166700466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700466">(May 28 2019 at 09:58)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> well unless you have <code>fn foo&lt;const A: usize&gt;(const B: usize)</code></p>



<a name="166700477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700477">(May 28 2019 at 09:58)</a>:</h4>
<p>there's no link between the 3 in the <code>&lt;..&gt;</code> and the 3 in the <code>(..)</code></p>



<a name="166700505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700505">(May 28 2019 at 09:59)</a>:</h4>
<p>That makes A and B different - my point was about whether they can be the same</p>



<a name="166700529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700529">(May 28 2019 at 09:59)</a>:</h4>
<p>like, say I want to create a <code>fn()-&gt;()</code> to a <code>fn foo(const A: usize)</code> where <code>A==3</code></p>



<a name="166700607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700607">(May 28 2019 at 10:00)</a>:</h4>
<p><code>let ptr: fn(3)-&gt;() = foo::&lt;3&gt;();</code> would not work</p>



<a name="166700639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700639">(May 28 2019 at 10:01)</a>:</h4>
<p><code>let ptr: fn() = foo::&lt;{3}&gt;();</code> should work out of the box I think</p>



<a name="166700659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700659">(May 28 2019 at 10:01)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> we don't have partial application</p>



<a name="166700661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700661">(May 28 2019 at 10:01)</a>:</h4>
<p>but just like with impl trait in argument position, that won't work for const in arugment position</p>



<a name="166700664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700664">(May 28 2019 at 10:01)</a>:</h4>
<p>which is what you'd need for htis</p>



<a name="166700666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700666">(May 28 2019 at 10:01)</a>:</h4>
<p>@oli if <code>foo&lt;const A: usize&gt;();</code> yes, but if <code>foo(const A: usize);</code> then only if there is some link between <code>&lt;{3}&gt;</code> and <code>(...)</code></p>



<a name="166700667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700667">(May 28 2019 at 10:01)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> we do for generics</p>



<a name="166700673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700673">(May 28 2019 at 10:01)</a>:</h4>
<p>ah yes</p>



<a name="166700693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700693">(May 28 2019 at 10:02)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  no that's not partial application</p>



<a name="166700725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700725">(May 28 2019 at 10:02)</a>:</h4>
<p>if we find a solution for impl trait in arg position we have a solution for const in arg position</p>



<a name="166700728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700728">(May 28 2019 at 10:02)</a>:</h4>
<p>if you supply 1 argument to the <code>&lt;...&gt;</code> you must provide all</p>



<a name="166700729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700729">(May 28 2019 at 10:02)</a>:</h4>
<p>it's exactly the same problem</p>



<a name="166700731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700731">(May 28 2019 at 10:02)</a>:</h4>
<p>yes</p>



<a name="166700767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700767">(May 28 2019 at 10:03)</a>:</h4>
<p>The difference between <code>&lt;...&gt;</code> and <code>(...)</code> is well studied in type theory really</p>



<a name="166700780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700780">(May 28 2019 at 10:03)</a>:</h4>
<p>and the only difference is one of type inference</p>



<a name="166700796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700796">(May 28 2019 at 10:03)</a>:</h4>
<p>so given that <code>fn foo&lt;const A: usize&gt;()</code> already exists, the question is how to extend that to <code>fn bar(const A: usize)</code>, such that one can still specify the <code>A</code> parameter for <code>bar</code></p>



<a name="166700848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700848">(May 28 2019 at 10:04)</a>:</h4>
<p>or to decide that we don't want to support that at all</p>



<a name="166700858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700858">(May 28 2019 at 10:04)</a>:</h4>
<p>we currently don't support that for <code>impl Trait</code></p>



<a name="166700873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700873">(May 28 2019 at 10:04)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> we already have <code>fn bar(const A: usize)</code> in the type system</p>



<a name="166700879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700879">(May 28 2019 at 10:04)</a>:</h4>
<p>just with weird syntax</p>



<a name="166700907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700907">(May 28 2019 at 10:05)</a>:</h4>
<p>and you can already specify the <code>A</code> parameter for <code>bar</code></p>



<a name="166700913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700913">(May 28 2019 at 10:05)</a>:</h4>
<p>that's why i said that this is a given</p>



<a name="166700918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700918">(May 28 2019 at 10:05)</a>:</h4>
<p>this isn't related to impl Trait at all</p>



<a name="166700926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700926">(May 28 2019 at 10:05)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> how would you pass the <code>A</code> parameter for <code>bar</code> ?</p>



<a name="166700935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700935">(May 28 2019 at 10:05)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> <code>bar(3)</code></p>



<a name="166700985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700985">(May 28 2019 at 10:06)</a>:</h4>
<p>how do you take a function pointer to that ?</p>



<a name="166700987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166700987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166700987">(May 28 2019 at 10:06)</a>:</h4>
<p>I think the only difference is whether parameters can be inferred or not, as <span class="user-mention" data-user-id="126931">@centril</span> says</p>



<a name="166701004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701004">(May 28 2019 at 10:06)</a>:</h4>
<p>although if you need pointers too...</p>



<a name="166701012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701012">(May 28 2019 at 10:06)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> <code>bar(3)</code> passes the parameter to bar, and calls it</p>



<a name="166701017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701017">(May 28 2019 at 10:06)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> <code>let x: fn(const A: usize) = bar;</code></p>



<a name="166701027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701027">(May 28 2019 at 10:06)</a>:</h4>
<p>that's different from just passing the parameter to bar</p>



<a name="166701055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701055">(May 28 2019 at 10:07)</a>:</h4>
<p>as I said, we don't have partial application</p>



<a name="166701060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701060">(May 28 2019 at 10:07)</a>:</h4>
<p>do you need a pointer to a function with a specific value?</p>



<a name="166701080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701080">(May 28 2019 at 10:07)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> I think that's what they want</p>



<a name="166701141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701141">(May 28 2019 at 10:08)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=28eae3d99eef208f35b54448607c792a" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=28eae3d99eef208f35b54448607c792a">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=28eae3d99eef208f35b54448607c792a</a></p>



<a name="166701150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701150">(May 28 2019 at 10:08)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="nc">T</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">bar</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_ptr</span>: <span class="nc">fn</span><span class="p">(</span><span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">i32</span> <span class="o">=</span><span class="w"> </span><span class="n">foo</span>::<span class="o">&lt;</span><span class="kt">i32</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="166701153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701153">(May 28 2019 at 10:08)</a>:</h4>
<p>that works today</p>



<a name="166701170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701170">(May 28 2019 at 10:08)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> yes because that's in the <code>&lt;...&gt;</code></p>



<a name="166701188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701188">(May 28 2019 at 10:09)</a>:</h4>
<p>you shouldn't be allowed to take a function pointer of <code>fn(const)</code></p>



<a name="166701190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701190">(May 28 2019 at 10:09)</a>:</h4>
<p>exactly, and my question is, should (...) forbid you from doing that ?</p>



<a name="166701192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701192">(May 28 2019 at 10:09)</a>:</h4>
<p>if you write <code>fn foo(x: usize)</code> we don't allow you to partially apply <code>foo</code> either</p>



<a name="166701201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701201">(May 28 2019 at 10:09)</a>:</h4>
<p>that's a big different between ITAP and generics</p>



<a name="166701210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701210">(May 28 2019 at 10:09)</a>:</h4>
<p>ITAP?</p>



<a name="166701216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701216">(May 28 2019 at 10:09)</a>:</h4>
<p>impl trait in argument position</p>



<a name="166701217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701217">(May 28 2019 at 10:09)</a>:</h4>
<p>APIT</p>



<a name="166701219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701219">(May 28 2019 at 10:09)</a>:</h4>
<p>APIT <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="166701225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701225">(May 28 2019 at 10:09)</a>:</h4>
<p>:P</p>



<a name="166701226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701226">(May 28 2019 at 10:09)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> damn you! :P</p>



<a name="166701305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701305">(May 28 2019 at 10:10)</a>:</h4>
<p>you don't need the ability to partially apply explicit const generic parameters to have <code>#[rustc_whatever_it_was_named]</code> be removed</p>



<a name="166701428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701428">(May 28 2019 at 10:13)</a>:</h4>
<p>that's correct</p>



<a name="166701469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701469">(May 28 2019 at 10:13)</a>:</h4>
<p>an RFC for adding a feature to allow <code>#[rustc_whatever]</code> to be removed might need to argue that this is not required, desired, a future compatible extension, etc.</p>



<a name="166701541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701541">(May 28 2019 at 10:14)</a>:</h4>
<p>maybe; it is not expected by any type theory I know of</p>



<a name="166701582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701582">(May 28 2019 at 10:15)</a>:</h4>
<p><a href="https://internals.rust-lang.org/t/pre-rfc-const-function-arguments/6709" target="_blank" title="https://internals.rust-lang.org/t/pre-rfc-const-function-arguments/6709">https://internals.rust-lang.org/t/pre-rfc-const-function-arguments/6709</a></p>



<a name="166701587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701587">(May 28 2019 at 10:15)</a>:</h4>
<p>that one argues that this is not supported</p>



<a name="166701688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701688">(May 28 2019 at 10:16)</a>:</h4>
<p><code>#[rustc_args_required_const]</code> already forbids taking a function pointer ("this function can only be invoked directly, not through a function pointer"). i don't see any controversy disallowing <code>fn(const)</code> pointers</p>



<a name="166701800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701800">(May 28 2019 at 10:18)</a>:</h4>
<p>An RFC today would probably need to discuss <code>fn foo() -&gt; const usize</code> as well</p>



<a name="166701812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701812">(May 28 2019 at 10:18)</a>:</h4>
<p>At least say that this is out-of-scope for the RFC</p>



<a name="166701843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701843">(May 28 2019 at 10:19)</a>:</h4>
<p>why would you want to return a const?</p>



<a name="166701855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701855">(May 28 2019 at 10:19)</a>:</h4>
<p>why not just use <code>const X: usize = { .. };</code>?</p>



<a name="166701876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701876">(May 28 2019 at 10:19)</a>:</h4>
<p>or rather to rephrase: why do you want to require that the return value be a compile time value?</p>



<a name="166701878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701878">(May 28 2019 at 10:19)</a>:</h4>
<p>(similarly, you cannot return lifetimes — so the generic parameters a function takes as input doesn't have to line up with the output)</p>



<a name="166701886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701886">(May 28 2019 at 10:20)</a>:</h4>
<p>if you want to have the possibility, use <code>const fn</code></p>



<a name="166701946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701946">(May 28 2019 at 10:20)</a>:</h4>
<p>are we talking about <code>fn x(const y: usize)</code> (<code>const</code> applied to arg) or <code>fn x(y: const usize)</code> (<code>const</code> applied to type)</p>



<a name="166701974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701974">(May 28 2019 at 10:20)</a>:</h4>
<p><span class="user-mention" data-user-id="125254">@kennytm</span>  they are functionally equivalent, no?</p>



<a name="166701978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166701978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166701978">(May 28 2019 at 10:20)</a>:</h4>
<p>@varkor &gt;why would you want to return a const?</p>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">init_buffer</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="n">X</span>: <span class="kt">usize</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="o">*</span><span class="n">ptr</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">usize</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">      </span><span class="k">const</span><span class="w"> </span><span class="n">MIN_BUFF_SIZE</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="p">...</span><span class="k">const</span><span class="w"> </span><span class="k">fn</span><span class="p">(</span><span class="n">x</span><span class="p">)...;</span><span class="w"></span>
<span class="w">      </span><span class="p">...</span><span class="n">alloc</span><span class="p">...</span><span class="w"></span>
<span class="w">     </span><span class="p">(</span><span class="n">ptr</span><span class="p">,</span><span class="w"> </span><span class="n">MIN_BUFF_SIZE</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>maybe</p>



<a name="166702012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702012">(May 28 2019 at 10:21)</a>:</h4>
<p>unless you try to do <code>fn foo(x: (const u8, String))</code></p>



<a name="166702033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702033">(May 28 2019 at 10:21)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> the implication of latter is more powerful <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="166702083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702083">(May 28 2019 at 10:22)</a>:</h4>
<p><span class="user-mention" data-user-id="125254">@kennytm</span> yea it is</p>



<a name="166702091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702091">(May 28 2019 at 10:22)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> and I discussed it a bunch</p>



<a name="166702094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702094">(May 28 2019 at 10:22)</a>:</h4>
<p>we got into some category theory and talked about functors iirc</p>



<a name="166702137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702137">(May 28 2019 at 10:23)</a>:</h4>
<p>meanwhile the former is just a nicer form of <code>#[rustc_args_required_const]</code></p>



<a name="166702216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702216">(May 28 2019 at 10:24)</a>:</h4>
<p><span class="user-mention" data-user-id="125254">@kennytm</span> one might imagine <code>fn foo&lt;T: const usize&gt;(...)</code> and <code>fn foo&lt;T: usize&gt;(...)</code> converesely</p>



<a name="166702222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702222">(May 28 2019 at 10:24)</a>:</h4>
<p>dependent types <span aria-label="rocket" class="emoji emoji-1f680" role="img" title="rocket">:rocket:</span></p>



<a name="166702483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702483">(May 28 2019 at 10:28)</a>:</h4>
<blockquote>
<p>IIRC <code>impl Trait</code> is always an existential type, but in argument position it is isomorphic to a similar universally quantified type</p>
</blockquote>
<p>that's actually quite nice, somehow this had not occurred to me even though I otherwise use that isomorphism all the time :)</p>



<a name="166702545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702545">(May 28 2019 at 10:29)</a>:</h4>
<p>though the question remains... and now I have a deja-vu, I feel I discussed this at some point but not sure in which context... when you start nesting things, like <code>fn foo(fn(impl Trait) -&gt; impl Trait)</code>, the "proper" thing you'd expect is that the existentials are like <code>fn foo(fn(exists T: Trait, T) -&gt; (exists T: Trait, T))</code>.</p>



<a name="166702610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702610">(May 28 2019 at 10:30)</a>:</h4>
<p>but I guess in Rust it translates to <code>fn foo(exists (T1: Trait) (T2: Trait), fn(T1) -&gt; T2)</code>. which is not the same.</p>



<a name="166702691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702691">(May 28 2019 at 10:31)</a>:</h4>
<p>It should be equivalent to (using the isomorphism): <code>exists A: Trait. forall B: Trait. fn foo(fn(A) -&gt; B)</code></p>



<a name="166702814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702814">(May 28 2019 at 10:33)</a>:</h4>
<p>no</p>



<a name="166702830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702830">(May 28 2019 at 10:33)</a>:</h4>
<p>it is equivalent to <code>fn foo(forall A: Trait, fn(A) -&gt; (exists B: Trait, B))</code></p>



<a name="166702839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702839">(May 28 2019 at 10:33)</a>:</h4>
<p>actually... it is not clear what this means because of function pointers</p>



<a name="166702846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702846">(May 28 2019 at 10:33)</a>:</h4>
<p>which is not representable in Rust</p>



<a name="166702922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166702922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166702922">(May 28 2019 at 10:34)</a>:</h4>
<p>though if we think of the <code>Fn</code> trait instead, if we had higher-ranked trait bounds for types, we could write</p>
<div class="codehilite"><pre><span></span>fn foo&lt;F: for &lt;T: Trait&gt; Fn(T) -&gt; impl U&gt;(f: F)
</pre></div>


<p>not sure if the <code>U</code> part would work though^^</p>



<a name="166703164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166703164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166703164">(May 28 2019 at 10:38)</a>:</h4>
<p>where did you get the U from?</p>



<a name="166703180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166703180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166703180">(May 28 2019 at 10:39)</a>:</h4>
<p>(this is probably a different thread tho)</p>



<a name="166704423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704423">(May 28 2019 at 10:58)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> would you be willing to champion an RFC of the form of the internal one, for adding const function arguments support (only, no return type, no way to specify types via <code>&lt;...&gt;</code> for <code>(...)</code> arguments, etc. ?</p>



<a name="166704453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704453">(May 28 2019 at 10:59)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  champion as in write it up?</p>



<a name="166704543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704543">(May 28 2019 at 11:00)</a>:</h4>
<p>no, champion as in "help" pushing it through the process. That is, I'll update and improve the internals one, send a github link to you, maybe <span class="user-mention" data-user-id="121053">@varkor</span> and <span class="user-mention" data-user-id="125254">@kennytm</span> for initial feedback, proof reading, etc. and then once that looks good, submit it as a PR to the RFC repo</p>



<a name="166704561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704561">(May 28 2019 at 11:00)</a>:</h4>
<p>but i don't think we should do any of that if there is no interest in tackling this issue in the next months by the lang team</p>



<a name="166704599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704599">(May 28 2019 at 11:01)</a>:</h4>
<p>There probably isn't -- I think we should see to RFC 2000 (const generics) first before doing any extensions -- also, it is the "maturity" year</p>



<a name="166704607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704607">(May 28 2019 at 11:01)</a>:</h4>
<p>I've almost stopped all new language design</p>



<a name="166704609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704609">(May 28 2019 at 11:01)</a>:</h4>
<p>so by champion i mean, "facilitator" (is that the new term?) - pinging the appropriate team, making sure that either there is progress, or that it is clear why there isn't, so that something can be done about it (or just postpone)</p>



<a name="166704678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704678">(May 28 2019 at 11:02)</a>:</h4>
<p>so, this is precisely why <code>#[rustc_whatever_const_arg]</code> exists</p>



<a name="166704711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704711">(May 28 2019 at 11:03)</a>:</h4>
<p>you could have done other hacks which would have relied on <code>&lt;..&gt;</code> instead of <code>(...)</code></p>



<a name="166704725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704725">(May 28 2019 at 11:03)</a>:</h4>
<p>that wouldn't have allowed us to match the C intrinsics</p>



<a name="166704726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704726">(May 28 2019 at 11:03)</a>:</h4>
<p>e.g. always emit "ambiguous type"</p>



<a name="166704743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704743">(May 28 2019 at 11:03)</a>:</h4>
<p>being able to call <code>foo(...)</code> was a requirement, instead of <code>foo::&lt;{ ... }&gt;(...)</code></p>



<a name="166704753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704753">(May 28 2019 at 11:04)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> why is that a requirement?</p>



<a name="166704801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704801">(May 28 2019 at 11:04)</a>:</h4>
<p>we RFC'ed that the C intrinsics should look like.. well.. C</p>



<a name="166704826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704826">(May 28 2019 at 11:04)</a>:</h4>
<p>C does not have "generics", turbofish, etc.</p>



<a name="166704848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704848">(May 28 2019 at 11:05)</a>:</h4>
<p>seems unimportant to me that you should be able to call them as <code>(...)</code> instead of <code>&lt;...&gt;</code> if that complicates the type theory</p>



<a name="166704853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704853">(May 28 2019 at 11:05)</a>:</h4>
<p>it doesn't have const generics, overloading, etc. either - all C compilers make these builtins</p>



<a name="166704858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704858">(May 28 2019 at 11:05)</a>:</h4>
<p>yeah, not important</p>



<a name="166704864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704864">(May 28 2019 at 11:05)</a>:</h4>
<p>i didn't rfc'ed that</p>



<a name="166704886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704886">(May 28 2019 at 11:05)</a>:</h4>
<p>i was just working within the rfc'ed constraints, and that was a constrait: we don't change the API of the intrinsics</p>



<a name="166704893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704893">(May 28 2019 at 11:06)</a>:</h4>
<p>I think the thing one should care about is discoverability and having the actual hardware capabilities</p>



<a name="166704955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704955">(May 28 2019 at 11:06)</a>:</h4>
<p>there is zero Rust documentation about the 5000 intrinsics that we expose today</p>



<a name="166704956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704956">(May 28 2019 at 11:06)</a>:</h4>
<p>the simd intrinsics are not ergonomic in any case</p>



<a name="166704964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166704964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166704964">(May 28 2019 at 11:06)</a>:</h4>
<p>so being able to reuse the C documentation, was considered very valuable</p>



<a name="166705000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705000">(May 28 2019 at 11:07)</a>:</h4>
<p>IIRC, that was the main reason, the second main reason was not doing any new API design, because if we have to do API design for the 10000 intrinsics that are in the list, that would take forever</p>



<a name="166705012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705012">(May 28 2019 at 11:07)</a>:</h4>
<p>and each new API design would need to be reviewed, RFC, manually verified, etc.</p>



<a name="166705015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705015">(May 28 2019 at 11:07)</a>:</h4>
<p>I think it would be fairly easy to communicate that the sole <code>&lt;const: A: B&gt;</code> parameter is the one that corresponds to the C one in all cases</p>



<a name="166705020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705020">(May 28 2019 at 11:08)</a>:</h4>
<p>and you could do this translation mechanically</p>



<a name="166705069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705069">(May 28 2019 at 11:08)</a>:</h4>
<p>some intrinsics take multiple <code>const</code> argument IIRC</p>



<a name="166705071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705071">(May 28 2019 at 11:08)</a>:</h4>
<blockquote>
<p>and each new API design would need to be reviewed, RFC, manually verified, etc.</p>
</blockquote>
<p>I don't see why... just shuffle any const argument to be in <code>&lt;..&gt;</code></p>



<a name="166705079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705079">(May 28 2019 at 11:08)</a>:</h4>
<p>OK; then do them in order, left to right</p>



<a name="166705091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705091">(May 28 2019 at 11:08)</a>:</h4>
<p>I'm not saying it is impossible, i'm saying, that's what was RFCed</p>



<a name="166705112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705112">(May 28 2019 at 11:09)</a>:</h4>
<p>complicating the type theory for some vague "should be like C" benefits seems like not taking complexity in the type theory seriously enough</p>



<a name="166705117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705117">(May 28 2019 at 11:09)</a>:</h4>
<p>Yeah I understand</p>



<a name="166705118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705118">(May 28 2019 at 11:09)</a>:</h4>
<p>and back then, nobody rejected <code>#[rustc_const_arg_...]</code> either, because const function arguments seemed worth doing anyways</p>



<a name="166705134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705134">(May 28 2019 at 11:09)</a>:</h4>
<p>so it wasn't that const function arguments weren't explored either _before_ adding <code>#[rustc_const_arg]</code></p>



<a name="166705196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705196">(May 28 2019 at 11:10)</a>:</h4>
<p>nobody suggested using <code>&lt;...&gt;</code> instead of <code>(...)</code></p>



<a name="166705197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705197">(May 28 2019 at 11:10)</a>:</h4>
<blockquote>
<p>because const function arguments seemed worth doing anyways</p>
</blockquote>
<p>I hope this turns out to be true...</p>



<a name="166705207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705207">(May 28 2019 at 11:10)</a>:</h4>
<p>would be pretty sad to have <code>#[rustc_const_arg...]</code> forever</p>



<a name="166705209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705209">(May 28 2019 at 11:10)</a>:</h4>
<p>there are some intrinsics that we can't implement right now because it isn't</p>



<a name="166705257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705257">(May 28 2019 at 11:11)</a>:</h4>
<p>so i hope so too</p>



<a name="166705348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705348">(May 28 2019 at 11:12)</a>:</h4>
<p>"because it isn't" it isn't what?</p>



<a name="166705363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705363">(May 28 2019 at 11:13)</a>:</h4>
<p>because it isn't a true const</p>



<a name="166705366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705366">(May 28 2019 at 11:13)</a>:</h4>
<p>just a lint</p>



<a name="166705390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705390">(May 28 2019 at 11:13)</a>:</h4>
<p>as in, <code>#[rustc_const_arg(N)]</code> is only a lint, so some intrinsics cannot be implemented right now with it</p>



<a name="166705815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166705815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166705815">(May 28 2019 at 11:19)</a>:</h4>
<p>I do think it's a shame that this was stabilised like this, rather than as const generics, as it's essentially just a less powerful version with different syntax... but if it hadn't been, it would have had to remain unstable for a lot longer, because of const generics<br>
(though we could probably just have used the CG syntax without true CGs...)</p>



<a name="166706065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706065">(May 28 2019 at 11:23)</a>:</h4>
<p>I don't see any reason to make this feature available to users, though, because as far as I see, it's completely subsumed by CGs</p>



<a name="166706080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706080">(May 28 2019 at 11:23)</a>:</h4>
<p>the only difference being whether the arguments can be inferred or not</p>



<a name="166706274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706274">(May 28 2019 at 11:26)</a>:</h4>
<p>Then the fix for these would actually be not to add a "const function arguments" feature, but to keep <code>#[rustc_const_arg]</code> forever and extend it to make those arguments actually implicitly const generic "somehow"</p>



<a name="166706340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706340">(May 28 2019 at 11:27)</a>:</h4>
<p>many intrinsics can be implemented without doing this, but doing it that way has a big cost, and the intrinsics that cannot be implemented with this today, aren't implemented not because writing the code is impossible, but because doing so makes compile-times explode</p>



<a name="166706401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706401">(May 28 2019 at 11:28)</a>:</h4>
<p>last time we tested, the compilation time of the standard library increased by ~10min per each time one of these intrinsics is used</p>



<a name="166706425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706425">(May 28 2019 at 11:28)</a>:</h4>
<p>so if you call them 4 times in the std library, you bump the compilation time of libstd by 40 minutes</p>



<a name="166706432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706432">(May 28 2019 at 11:28)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> Agda and Idris both have <code>{A: Type}</code>and <code>(A: Type)</code> so it doesn't seem strange to me</p>



<a name="166706564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706564">(May 28 2019 at 11:30)</a>:</h4>
<p>being able to pick whether something should be inferrable or not seems like a nice thing to give users</p>



<a name="166706589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706589">(May 28 2019 at 11:30)</a>:</h4>
<p>users can't build abstractions on top of these intrinsics today</p>



<a name="166706594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706594">(May 28 2019 at 11:30)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span>: if we want to control inference specifically, it should be extended to all parameters, not just consts</p>



<a name="166706600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706600">(May 28 2019 at 11:30)</a>:</h4>
<p>and they wouldn't be able to do this even if const generics was stable</p>



<a name="166706607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706607">(May 28 2019 at 11:30)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> I mean... I agree that <code>fn foo(A: type)</code> would be nice</p>



<a name="166706609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706609">(May 28 2019 at 11:31)</a>:</h4>
<p>also, it's not the same as Agda, etc. because you have an additional compile-time requirement</p>



<a name="166706657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706657">(May 28 2019 at 11:31)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> but I don't think we have to do "all or nothing"</p>



<a name="166706663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706663">(May 28 2019 at 11:31)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>: we might be able to retroactively change that, so the syntax is just sugar for const generics, which would allow them to interact nicely</p>



<a name="166706716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706716">(May 28 2019 at 11:32)</a>:</h4>
<p>its sad having to add this feature just for this</p>



<a name="166706721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706721">(May 28 2019 at 11:32)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span>: it's possibly less useful though</p>



<a name="166706729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706729">(May 28 2019 at 11:32)</a>:</h4>
<p>(though maybe still valuable)</p>



<a name="166706730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706730">(May 28 2019 at 11:32)</a>:</h4>
<p>removing the <code>#[rustc_const_arg]</code> hack through <code>const A: B</code> seems like a useful intermediary step</p>



<a name="166706733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706733">(May 28 2019 at 11:32)</a>:</h4>
<p>one advantage is not having to write the <code>::&lt;{ ... }&gt;</code>, but i wish we could gain that independently of whether const generics are used or "this"</p>



<a name="166706775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706775">(May 28 2019 at 11:33)</a>:</h4>
<p>i mean, if we provide <code>(...)</code>, why would a user write const generics ?</p>



<a name="166706776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706776">(May 28 2019 at 11:33)</a>:</h4>
<p>(that would be nicer without turbofish <span aria-label="smiling devil" class="emoji emoji-1f608" role="img" title="smiling devil">:smiling_devil:</span>)</p>



<a name="166706788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706788">(May 28 2019 at 11:33)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  it's still const generics</p>



<a name="166706797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706797">(May 28 2019 at 11:33)</a>:</h4>
<p>we've essentially just got two ways of writing the same thing now</p>



<a name="166706798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706798">(May 28 2019 at 11:33)</a>:</h4>
<p>the only difference is inference/no</p>



<a name="166706802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706802">(May 28 2019 at 11:33)</a>:</h4>
<p>If we provide <code>fn foo(const X: T);</code> why would anyone prefer <code>fn foo&lt;const X: T&gt;()</code> instead ?</p>



<a name="166706855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706855">(May 28 2019 at 11:34)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> cause you get inference</p>



<a name="166706874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706874">(May 28 2019 at 11:34)</a>:</h4>
<p>so that's useful, but why wouldn't you be able to get inference with <code>const X: T</code> syntax as well ?</p>



<a name="166706898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166706898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166706898">(May 28 2019 at 11:34)</a>:</h4>
<p>e.g. <code>fn foo(const X: usize) where  X == 0 { .. }</code></p>



<a name="166707012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707012">(May 28 2019 at 11:36)</a>:</h4>
<p>I'd find the trade-off: const-generics: inference but <code>{...}</code>-syntax vs const-arg: no-inference but nice-syntax unnecessary</p>



<a name="166707172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707172">(May 28 2019 at 11:39)</a>:</h4>
<p>cause that's what you have with <code>(...)</code></p>



<a name="166707192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707192">(May 28 2019 at 11:39)</a>:</h4>
<p>Sure, I just think it is sub-optimal to have to make that choice</p>



<a name="166707201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707201">(May 28 2019 at 11:39)</a>:</h4>
<p>this is the problem</p>



<a name="166707213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707213">(May 28 2019 at 11:39)</a>:</h4>
<p>we now have two syntaxes, and the "proper" one looks uglier</p>



<a name="166707267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707267">(May 28 2019 at 11:40)</a>:</h4>
<p>yeah :/</p>



<a name="166707272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707272">(May 28 2019 at 11:40)</a>:</h4>
<p>well it's two syntaxes for two different things</p>



<a name="166707289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707289">(May 28 2019 at 11:40)</a>:</h4>
<p>slightly-different things</p>



<a name="166707296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707296">(May 28 2019 at 11:40)</a>:</h4>
<p>being able to force non-inference is useful</p>



<a name="166707315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707315">(May 28 2019 at 11:41)</a>:</h4>
<p>"I really want people to specify things explicitly here"</p>



<a name="166707326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707326">(May 28 2019 at 11:41)</a>:</h4>
<p>can we get inference + being able to use the type in where clauses, bounds, etc. ?</p>



<a name="166707347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707347">(May 28 2019 at 11:41)</a>:</h4>
<p>e.g., <code>fn foo&lt;A: [i32; N]&gt;(const N: usize, x: Vec&lt;A&gt;) where N &gt; 0, A: SomeTrait -&gt; A { ... }</code> ?</p>



<a name="166707421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707421">(May 28 2019 at 11:42)</a>:</h4>
<p>I mean you can assign that meaning to that syntax if you want</p>



<a name="166707425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707425">(May 28 2019 at 11:42)</a>:</h4>
<p>it's surprising tho.</p>



<a name="166707471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707471">(May 28 2019 at 11:44)</a>:</h4>
<p>if we were to do that, the only reason for an user to prefer <code>fn foo&lt;const X: usize&gt;()</code> over <code>fn bar(const X: usize)</code> is "i explicitly want to forbid inference"</p>



<a name="166707585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707585">(May 28 2019 at 11:45)</a>:</h4>
<p>that's sometimes desirable, but most of the time APIs with  inference are more appropriate</p>



<a name="166707593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707593">(May 28 2019 at 11:45)</a>:</h4>
<p><code>&lt;A: [i32; N]&gt;</code> presumably is runtime dependent typing</p>



<a name="166707729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707729">(May 28 2019 at 11:47)</a>:</h4>
<p>no, i screwed the type signature up, what i meant is:</p>
<p><code>fn foo&lt;A&gt;(const N: usize, x: B&lt;N&gt;, z: A) where N &gt; 0 , A: SomeTrait&lt;N&gt; -&gt; C&lt;N&gt; { ... }</code></p>



<a name="166707748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707748">(May 28 2019 at 11:47)</a>:</h4>
<p>so that <code>N</code> is inferred, but it still can be used in where clauses / trait bounds, etc.</p>



<a name="166707889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707889">(May 28 2019 at 11:49)</a>:</h4>
<p>Aside: <code>where N &gt; 0 , A: SomeTrait&lt;N&gt; -&gt; C&lt;N&gt;</code> &lt;-- that's going to be fun in terms of parser ambiguity</p>



<a name="166707900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707900">(May 28 2019 at 11:49)</a>:</h4>
<p>if we were to allow this, <code>fn foo&lt;const X: usize&gt;()</code> would become super rare, and so would having to write <code>{ ... }</code> when passing const generics to functions in function calls</p>



<a name="166707909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707909">(May 28 2019 at 11:49)</a>:</h4>
<p>so it isn't necessarily a bad thing</p>



<a name="166707925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166707925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166707925">(May 28 2019 at 11:49)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> we could have <code>where { N &gt; 0 }</code></p>



<a name="166708005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166708005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166708005">(May 28 2019 at 11:50)</a>:</h4>
<p>yeah</p>



<a name="166708021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166708021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166708021">(May 28 2019 at 11:50)</a>:</h4>
<p><code>where N &gt; 0 , A: Fn() -&gt; C&lt;N&gt;</code> <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="166708053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166708053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166708053">(May 28 2019 at 11:51)</a>:</h4>
<p>(you can pick a parse, so it's not so bad)</p>



<a name="166708283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166708283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166708283">(May 28 2019 at 11:54)</a>:</h4>
<p>it seems that here it is just better to wait for stable const generics, and then re-consider this as something to build on top of that</p>



<a name="166711270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711270">(May 28 2019 at 12:34)</a>:</h4>
<p>re. inference: it's not clear that not inferring the arguments is an intentional decision, rather than just being easier to implement</p>



<a name="166711305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711305">(May 28 2019 at 12:34)</a>:</h4>
<p>in which case it's an implementation limitation and should hence be equivalent exactly to const generics</p>



<a name="166711491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711491">(May 28 2019 at 12:37)</a>:</h4>
<p>The distinction between <code>&lt;..&gt;</code> and <code>(..)</code> in terms of inference seems clear to me at least</p>



<a name="166711497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711497">(May 28 2019 at 12:37)</a>:</h4>
<p>it's very much intentional in Agda/Idris</p>



<a name="166711913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711913">(May 28 2019 at 12:43)</a>:</h4>
<p>TBH I always viewed <code>&lt;...&gt;</code> vs <code>(...)</code> as compile-time vs run-time</p>



<a name="166711932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711932">(May 28 2019 at 12:43)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span>: yes, but this isn't Agda</p>



<a name="166711934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711934">(May 28 2019 at 12:43)</a>:</h4>
<p>and not as having anything to do with implicit/explicit arguments in agda/idris (coq has them too and I assume they are similar)</p>



<a name="166711937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711937">(May 28 2019 at 12:43)</a>:</h4>
<p>it's a coïncidence here</p>



<a name="166711981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711981">(May 28 2019 at 12:44)</a>:</h4>
<p>I also prefer to draw the distinction at <code>&lt;...&gt;</code> holding static / compile time parameters and arguments while <code>(...)</code> hold dynamic / run time ones. I understand that Centril would like to eliminate this distinction but current and historical Rust does have it and I don't see any consensus that should definitely change. With that in mind the presence vs absence of inference seems subordinate to me, a byproduct of type inference (for Rust's type system) being a neatly solved problem while expression synthesis is much more difficult.</p>



<a name="166711998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166711998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166711998">(May 28 2019 at 12:44)</a>:</h4>
<p>basically, what <span class="user-mention" data-user-id="124289">@rkruppe</span> said :)</p>



<a name="166712006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712006">(May 28 2019 at 12:44)</a>:</h4>
<p>I prefer thinking about the compile time distinction too</p>



<a name="166712029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712029">(May 28 2019 at 12:44)</a>:</h4>
<p>If we allow <code>(const A: B)</code> then that compiletime/runtime distinction goes away</p>



<a name="166712059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712059">(May 28 2019 at 12:45)</a>:</h4>
<p>I think we should treat that as a mistake</p>



<a name="166712068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712068">(May 28 2019 at 12:45)</a>:</h4>
<p>or "FFI sugar"</p>



<a name="166712097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712097">(May 28 2019 at 12:45)</a>:</h4>
<p>and not propagate it further</p>



<a name="166712182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712182">(May 28 2019 at 12:46)</a>:</h4>
<p>I personally don't find the compile-time/run-time distinction important nor useful pedagogically, especially when <code>const</code> itself helps to qualify things</p>



<a name="166712314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712314">(May 28 2019 at 12:48)</a>:</h4>
<p>It's also not clear to me why the inference aspect is subordinate to the staging aspect</p>



<a name="166712316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712316">(May 28 2019 at 12:48)</a>:</h4>
<p>Having one argument list just for compile time arguments and a separate one for run time arguments has the advantage that one doesn't need (to worry about) partial application to nail down the compile time parts and get e.g. a function pointer.</p>



<a name="166712365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712365">(May 28 2019 at 12:49)</a>:</h4>
<p>We don't have partial application for either part</p>



<a name="166712506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712506">(May 28 2019 at 12:50)</a>:</h4>
<p>From what <span class="user-mention" data-user-id="132920">@gnzlbg</span> says, having <code>(const A: B)</code> with or without seems like a necessity for some of the intrinsics</p>



<a name="166712550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712550">(May 28 2019 at 12:51)</a>:</h4>
<p>that, or we use <code>&lt;...&gt;</code> for some of the intrinsics</p>



<a name="166712553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712553">(May 28 2019 at 12:51)</a>:</h4>
<p>well we have "apply all the compile-time things but none of the run-time things"</p>



<a name="166712562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712562">(May 28 2019 at 12:51)</a>:</h4>
<p>which is partial application if we start mixing those</p>



<a name="166712564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712564">(May 28 2019 at 12:51)</a>:</h4>
<p>I thought we established partial application was not necessary</p>



<a name="166712584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712584">(May 28 2019 at 12:51)</a>:</h4>
<p>I also find this exact distinction extremely helpful pedagogically</p>



<a name="166712668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712668">(May 28 2019 at 12:52)</a>:</h4>
<p>Yes I was getting at what <span class="user-mention" data-user-id="120791">@RalfJ</span> said: we can currently go from <code>fn foo&lt;...&gt;(...) -&gt; R</code> to a <code>fn(...) -&gt; R</code> by supplying everything for the <code>&lt;...&gt;</code>. If you intermingle the statically-given parts in the <code>(...)</code> as well, there's no nice way to specify the static parts and get a monomorphic function without partial application.</p>



<a name="166712672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712672">(May 28 2019 at 12:52)</a>:</h4>
<p>You don't have partial application within either of the lists</p>



<a name="166712730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712730">(May 28 2019 at 12:53)</a>:</h4>
<p>Yes? I know that. I'm saying is we can do a useful thing now <em>without</em> having partial application, <em>because</em> there are two separate argument lists you can fill in entirely or not.</p>



<a name="166712832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712832">(May 28 2019 at 12:54)</a>:</h4>
<p>you can just not allow getting a function pointer when it has <code>(const A: B)</code> -- function pointers are of marginal utility anyways (eddyb hates them I hear... ^^)</p>



<a name="166712837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712837">(May 28 2019 at 12:54)</a>:</h4>
<p>i.e. what <span class="user-mention" data-user-id="121053">@varkor</span> said</p>



<a name="166712853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712853">(May 28 2019 at 12:54)</a>:</h4>
<p>It's not just function pointers, it's also non-higher-rank <code>Fn()</code>s</p>



<a name="166712879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712879">(May 28 2019 at 12:54)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> trait objects?</p>



<a name="166712947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166712947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166712947">(May 28 2019 at 12:55)</a>:</h4>
<p>For example. But also it's a pain to work with higher rank things (at least today, we'll see how much of that chalkification can fix)</p>



<a name="166713074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713074">(May 28 2019 at 12:56)</a>:</h4>
<p>Speaking of... going back to reviewing the most boring PR ever ^^</p>



<a name="166713665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713665">(May 28 2019 at 13:03)</a>:</h4>
<p>I don't know how we could make <code>(...)</code> run-time only</p>



<a name="166713713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713713">(May 28 2019 at 13:03)</a>:</h4>
<p>Well it is right now</p>



<a name="166713719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713719">(May 28 2019 at 13:03)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">struct</span> <span class="nc">One</span><span class="p">;</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">TypeNum</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">One</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">Num</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="nc">T</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="166713742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713742">(May 28 2019 at 13:03)</a>:</h4>
<p>is <code>foo(One)</code> run-time ?</p>



<a name="166713750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713750">(May 28 2019 at 13:03)</a>:</h4>
<p>yes?</p>



<a name="166713760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713760">(May 28 2019 at 13:03)</a>:</h4>
<p><code>One</code> is a run-time value?</p>



<a name="166713810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713810">(May 28 2019 at 13:04)</a>:</h4>
<p>well it isn't "compile time only"</p>



<a name="166713863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713863">(May 28 2019 at 13:04)</a>:</h4>
<p>it isn't a run-time thing either, your CPU won't execute stuff with one</p>



<a name="166713865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713865">(May 28 2019 at 13:04)</a>:</h4>
<p>the compile-time argument is <code>One</code>, too (we use the same name for the type and the value but that does not make them the same thing)</p>



<a name="166713872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713872">(May 28 2019 at 13:04)</a>:</h4>
<p>It's <code>foo::&lt;One&gt;(One)</code> really.</p>



<a name="166713905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713905">(May 28 2019 at 13:05)</a>:</h4>
<p>if you use <code>typenum</code>, you can do arithmetic at compile-time, by passing "run-time" values like that</p>



<a name="166713938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713938">(May 28 2019 at 13:05)</a>:</h4>
<blockquote>
<p>It's foo::&lt;One&gt;(One) really.</p>
</blockquote>
<p>Well, yes.</p>



<a name="166713946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713946">(May 28 2019 at 13:05)</a>:</h4>
<p>LLVM or rustc may optimize away things but that's different</p>



<a name="166713947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713947">(May 28 2019 at 13:05)</a>:</h4>
<p>the arithemtic you are doing then is on the <em>type</em> <code>One</code>, not the <em>value</em> <code>One</code></p>



<a name="166713965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713965">(May 28 2019 at 13:05)</a>:</h4>
<blockquote>
<p>it isn't a run-time thing either, your CPU won't execute stuff with one</p>
</blockquote>
<p>that's an implementation detail (that ZSTs optimize away)</p>



<a name="166713993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166713993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166713993">(May 28 2019 at 13:05)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> aside: having a separate type and value namespace makes me sad</p>



<a name="166714050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714050">(May 28 2019 at 13:06)</a>:</h4>
<p>from a user-pov, i think it would be a disservice to const generics to have to teach the difference</p>



<a name="166714063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714063">(May 28 2019 at 13:06)</a>:</h4>
<p>well in a language without dependent types it's kinda useful ;)</p>



<a name="166714070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714070">(May 28 2019 at 13:06)</a>:</h4>
<p>it would be bad if const generics APIs end up being worse than using <code>typenum</code></p>



<a name="166714086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714086">(May 28 2019 at 13:06)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> yea but then you suddenly want ~dependent types (const generics in this case) and it gets bad</p>



<a name="166714090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714090">(May 28 2019 at 13:06)</a>:</h4>
<p>because <code>typenum</code> can be inferred, but const generics cannot</p>



<a name="166714097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714097">(May 28 2019 at 13:06)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> uh? I think if someone doesnt understand the difference between the type and value <code>One</code> they'll have a hard time</p>



<a name="166714104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714104">(May 28 2019 at 13:06)</a>:</h4>
<p>but for const generics this is different anyway</p>



<a name="166714107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714107">(May 28 2019 at 13:06)</a>:</h4>
<p>so I dont follow</p>



<a name="166714157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714157">(May 28 2019 at 13:07)</a>:</h4>
<p>then it'd be <code>foo::&lt;{1}&gt;()</code> or so. no runtime argument. right?</p>



<a name="166714164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714164">(May 28 2019 at 13:07)</a>:</h4>
<p>with typenum I can write: <code>let one = ..; let two = ..; let three = add(one, two);</code> and get a <code>three</code> value that's computed at compile-time</p>



<a name="166714193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714193">(May 28 2019 at 13:07)</a>:</h4>
<p>with const generics i'd gave to write <code>let three = add::&lt;{one, two}&gt;();</code></p>



<a name="166714214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714214">(May 28 2019 at 13:08)</a>:</h4>
<p>same amount of information though</p>



<a name="166714259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714259">(May 28 2019 at 13:08)</a>:</h4>
<p>just more annoying to type</p>



<a name="166714274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714274">(May 28 2019 at 13:08)</a>:</h4>
<p>what happens here is that you are using singleton types, basically</p>



<a name="166714285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714285">(May 28 2019 at 13:08)</a>:</h4>
<p>eww</p>



<a name="166714315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714315">(May 28 2019 at 13:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> have you seen the singletons haskell package?</p>



<a name="166714321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714321">(May 28 2019 at 13:08)</a>:</h4>
<p>but really <span class="user-mention" data-user-id="132920">@gnzlbg</span> you'd write <code>const THREE = ONE+TWO;</code></p>



<a name="166714331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714331">(May 28 2019 at 13:08)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> have you seen the singletons haskell package?</p>
</blockquote>
<p>no</p>



<a name="166714371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714371">(May 28 2019 at 13:09)</a>:</h4>
<p><code>let three = add::&lt;{one, two}&gt;();</code>  -- is this supposed to be a tuple?</p>



<a name="166714401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714401">(May 28 2019 at 13:09)</a>:</h4>
<p>just a typo I think. <code>let three = add::&lt;{one}, {two}&gt;();</code></p>



<a name="166714416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714416">(May 28 2019 at 13:09)</a>:</h4>
<p>still not sure why you'd call const addition by going through const generics^^</p>



<a name="166714432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714432">(May 28 2019 at 13:09)</a>:</h4>
<p>what's the return type of <code>add</code> anyway?</p>



<a name="166714436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714436">(May 28 2019 at 13:09)</a>:</h4>
<blockquote>
<p>no</p>
</blockquote>
<p>good <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span> -- it's a monstrosity (the author agrees)... hacking in dependent types through singleton types</p>



<a name="166714542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714542">(May 28 2019 at 13:10)</a>:</h4>
<blockquote>
<p>what's the return type of <code>add</code> anyway?</p>
</blockquote>
<p><code>Add&lt;One, Add&lt;One, One&gt;&gt;</code> or the binary version of that</p>



<a name="166714572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714572">(May 28 2019 at 13:10)</a>:</h4>
<p>no I mean in the const generics version, not in the numtypes version</p>



<a name="166714579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714579">(May 28 2019 at 13:10)</a>:</h4>
<p>ah</p>



<a name="166714596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714596">(May 28 2019 at 13:11)</a>:</h4>
<p>you don't do that :P</p>



<a name="166714604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714604">(May 28 2019 at 13:11)</a>:</h4>
<p>Just <code>3</code> ?</p>



<a name="166714606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714606">(May 28 2019 at 13:11)</a>:</h4>
<p>:P</p>



<a name="166714611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714611">(May 28 2019 at 13:11)</a>:</h4>
<p>that's what I mean :D</p>



<a name="166714626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714626">(May 28 2019 at 13:11)</a>:</h4>
<p>it'd be <code>const fn add(x: i32, y: i32) -&gt; i32</code> or so</p>



<a name="166714654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714654">(May 28 2019 at 13:11)</a>:</h4>
<p>I mean you can, but it would be <code>TypeNumber&lt;3&gt;</code> in that case</p>



<a name="166714661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714661">(May 28 2019 at 13:11)</a>:</h4>
<p>not <code>const fn&lt;X: i32, Y: i32&gt;() -&gt; Add&lt;X, Y&gt;</code> or whatever</p>



<a name="166714693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714693">(May 28 2019 at 13:11)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> <code>const usize</code>? what the heck is that?^^</p>



<a name="166714758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714758">(May 28 2019 at 13:12)</a>:</h4>
<p>that's what <code>TypeNumber&lt;3&gt;</code> is</p>



<a name="166714771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714771">(May 28 2019 at 13:12)</a>:</h4>
<p>I'm very confused</p>



<a name="166714775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714775">(May 28 2019 at 13:12)</a>:</h4>
<p><code>TypeNumber</code> is a hack you need when you dont have const generics</p>



<a name="166714787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714787">(May 28 2019 at 13:12)</a>:</h4>
<p>why do you still want to use that hack with const generics...?</p>



<a name="166714790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714790">(May 28 2019 at 13:12)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>  It's an idea me and <span class="user-mention" data-user-id="121053">@varkor</span> had about lifting <code>Type</code> to a <code>ConstType</code> universe</p>



<a name="166714797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714797">(May 28 2019 at 13:12)</a>:</h4>
<p>with typenum, what one writes is <code>fn&lt;const X: usize, const Y: usize&gt;() -&gt; const Z: usize</code></p>



<a name="166714815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714815">(May 28 2019 at 13:12)</a>:</h4>
<blockquote>
<p>with typenum, what one writes is <code>fn&lt;const X: usize, const Y: usize&gt;() -&gt; const Z: usize</code></p>
</blockquote>
<p>uh, why would one do that??</p>



<a name="166714834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714834">(May 28 2019 at 13:13)</a>:</h4>
<p>e.g. <code>let x: const usize = random(); // nope</code></p>



<a name="166714876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714876">(May 28 2019 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> that's orthogonal :P</p>



<a name="166714946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166714946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166714946">(May 28 2019 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> I don't know what that means^^</p>



<a name="166715001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715001">(May 28 2019 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> well you'd write <code>fn foo&lt;N: const usize&gt;</code> instead of <code>fn foo&lt;const N: usize&gt;</code> in that case</p>



<a name="166715019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715019">(May 28 2019 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> we barely know what it means as well :P</p>



<a name="166715077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715077">(May 28 2019 at 13:15)</a>:</h4>
<blockquote>
<p>uh, why would one do that??</p>
</blockquote>
<p>That's how typenum is implemented</p>



<a name="166715083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715083">(May 28 2019 at 13:15)</a>:</h4>
<p>as far as I am concerned both are just <code>&lt;N: usize&gt;</code>. as in, compile-time <code>usize</code>.</p>



<a name="166715094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715094">(May 28 2019 at 13:15)</a>:</h4>
<blockquote>
<blockquote>
<p>uh, why would one do that??</p>
</blockquote>
<p>That's how typenum is implemented</p>
</blockquote>
<p>yes because it doesnt have const generics</p>



<a name="166715108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715108">(May 28 2019 at 13:15)</a>:</h4>
<p>no need to kludge to an awful hack when you got the proper thing</p>



<a name="166715195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715195">(May 28 2019 at 13:16)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>  well... the gist of it is that <code>const T</code> is <code>{ x: T | is_constexpr(x) }</code></p>



<a name="166715212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715212">(May 28 2019 at 13:16)</a>:</h4>
<p>I don't know what type of argument you are trying to make</p>



<a name="166715237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715237">(May 28 2019 at 13:16)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span>  well... the gist of it is that <code>const T</code> is <code>{ x: T | is_constexpr(x) }</code></p>
</blockquote>
<p>that's ill-typed, <code>x</code> is a value and you are passing it to a term expecting an expression</p>



<a name="166715243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715243">(May 28 2019 at 13:16)</a>:</h4>
<p>with <code>typenum</code> you can write <code>fn foo(X: Typenum, y: usize) -&gt; usize</code></p>



<a name="166715266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715266">(May 28 2019 at 13:16)</a>:</h4>
<p>so that would become <code>fn foo&lt;X: usize&gt;(y: usize) -&gt; usize</code></p>



<a name="166715270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715270">(May 28 2019 at 13:16)</a>:</h4>
<p>so that i can write <code>let three = foo(N, run_time_val);</code></p>



<a name="166715293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715293">(May 28 2019 at 13:17)</a>:</h4>
<p>I consider having to write <code>let three = foo::&lt;{N}&gt;(run_time_val);</code> a regression</p>



<a name="166715300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715300">(May 28 2019 at 13:17)</a>:</h4>
<p>to me it looks like you want to recreate an old unergonomic API in a new framework that was specifrically designed to <em>not</em> require having to do those unergonomic things.</p>



<a name="166715322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715322">(May 28 2019 at 13:17)</a>:</h4>
<p>if you think that <code>foo::&lt;{N}&gt;(val)</code> is nicer than <code>foo(N, val)</code>, then just say so</p>



<a name="166715339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715339">(May 28 2019 at 13:17)</a>:</h4>
<p>i disagre, and we can call it a day</p>



<a name="166715365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715365">(May 28 2019 at 13:18)</a>:</h4>
<p>I think that's just syntax and I thought were were talking about something deeper than that</p>



<a name="166715403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715403">(May 28 2019 at 13:18)</a>:</h4>
<p>no</p>



<a name="166715406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715406">(May 28 2019 at 13:18)</a>:</h4>
<p>or not AFAICT</p>



<a name="166715415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715415">(May 28 2019 at 13:18)</a>:</h4>
<p>because currently what you are really writing is <code>foo::&lt;{N}&gt;(N, val)</code>, just you get some inference</p>



<a name="166715419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715419">(May 28 2019 at 13:18)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I don't follow; I'm using refinment type notation here for "Given a type, all the expressions of that type computable at compile time"</p>



<a name="166715439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715439">(May 28 2019 at 13:18)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> yeah but types classify values, not expressions</p>



<a name="166715456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715456">(May 28 2019 at 13:19)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> but because there is inference, I don't have to write <code>::&lt;{N}&gt;</code></p>



<a name="166715467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715467">(May 28 2019 at 13:19)</a>:</h4>
<p>so I dont see how that would work. unless you are going with thunks or call-by-name or so.</p>



<a name="166715494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715494">(May 28 2019 at 13:19)</a>:</h4>
<p>or is the argument that inference isn't important?</p>



<a name="166715515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715515">(May 28 2019 at 13:19)</a>:</h4>
<p>the only difference betwee const generics, and const function arguments is inference</p>



<a name="166715520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715520">(May 28 2019 at 13:19)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> sounds to me like you are looking for some kind of staged type system</p>



<a name="166715547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715547">(May 28 2019 at 13:20)</a>:</h4>
<p>then you get types on each stage -- like, a compile-time <code>T</code> and a run-time <code>T</code></p>



<a name="166715606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715606">(May 28 2019 at 13:20)</a>:</h4>
<p>these are not really sigma types though, that's a very different thing</p>



<a name="166715616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715616">(May 28 2019 at 13:20)</a>:</h4>
<p>it's more like a modality</p>



<a name="166715625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715625">(May 28 2019 at 13:20)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> me and <span class="user-mention" data-user-id="121053">@varkor</span> were discussing something like that yes</p>



<a name="166715641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715641">(May 28 2019 at 13:20)</a>:</h4>
<p>I don't literally mean a sigma type</p>



<a name="166715690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715690">(May 28 2019 at 13:21)</a>:</h4>
<blockquote>
<p>or is the argument that inference isn't important?</p>
</blockquote>
<p>inference is important. I was just under the impression that we talked about something else.^^</p>



<a name="166715717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715717">(May 28 2019 at 13:21)</a>:</h4>
<p>hence universes and "lifting" <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="166715750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715750">(May 28 2019 at 13:21)</a>:</h4>
<blockquote>
<p>the only difference betwee const generics, and const function arguments is inference</p>
</blockquote>
<p>no. the only difference is where you have to put your argument.</p>



<a name="166715772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715772">(May 28 2019 at 13:21)</a>:</h4>
<p><code>foo::&lt;{N}&gt;(y)</code> and <code>foo(N, y)</code> have the exact same amount of inference going on</p>



<a name="166715830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715830">(May 28 2019 at 13:22)</a>:</h4>
<p>assuming the latter is a const fn argument</p>



<a name="166715856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715856">(May 28 2019 at 13:22)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I think what <span class="user-mention" data-user-id="132920">@gnzlbg</span> is getting at is that the former would permit inference whereas the latter wouldn't</p>



<a name="166715862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715862">(May 28 2019 at 13:22)</a>:</h4>
<p>inference only comes into play when you consider the hack that is currently used to encode values in types</p>



<a name="166715864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715864">(May 28 2019 at 13:22)</a>:</h4>
<p>i.e. implicit vs. explicit arguments</p>



<a name="166715894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715894">(May 28 2019 at 13:22)</a>:</h4>
<p>then the two variants are <code>foo::&lt;{N}&gt;(N, y)</code> and <code>foo(N, y)</code>, but thanks to inference you can leave away one <code>N</code> in the former</p>



<a name="166715933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715933">(May 28 2019 at 13:23)</a>:</h4>
<p>that confused me before centril, but as @ralfj says, you get the same inference with both</p>



<a name="166715992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715992">(May 28 2019 at 13:23)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> note that today <code>foo::&lt;{N}&gt;(N)</code> is not allowed, only <code>foo::&lt;{N}&gt;()</code></p>



<a name="166715996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166715996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166715996">(May 28 2019 at 13:23)</a>:</h4>
<p>my impression here is that the complaint about using const generics to encode const fn arguments is only about syntax and has nothing to do with being implicit/explicit, or synax</p>



<a name="166716063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716063">(May 28 2019 at 13:24)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> note that today <code>foo::&lt;{N}&gt;(N)</code> is not allowed, only <code>foo::&lt;{N}&gt;()</code></p>
</blockquote>
<p>hu? I was assuming use of typenum there</p>



<a name="166716079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716079">(May 28 2019 at 13:24)</a>:</h4>
<p>then it's <code>add::&lt;One, One&gt;(One, One)</code>, right? in the code you wrote above (with <code>struct One;</code>)</p>



<a name="166716095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716095">(May 28 2019 at 13:24)</a>:</h4>
<p>well with const generics you can say: <code>fn foo&lt;const N: usize&gt;(x: [u8; N])</code> and then just write <code>foo([])</code> such that <code>N</code> is inferred to <code>0</code></p>



<a name="166716096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716096">(May 28 2019 at 13:24)</a>:</h4>
<p>I thought you were talking const generics</p>



<a name="166716120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716120">(May 28 2019 at 13:24)</a>:</h4>
<p>oh no so much talking past each other^^</p>



<a name="166716123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716123">(May 28 2019 at 13:24)</a>:</h4>
<blockquote>
<p>well with const generics you can say: <code>fn foo&lt;const N: usize&gt;(x: [u8; N])</code> and then just write <code>foo([])</code> such that <code>N</code> is inferred to <code>0</code></p>
</blockquote>
<p>having to do that, would suck</p>



<a name="166716135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716135">(May 28 2019 at 13:25)</a>:</h4>
<p>with const generics there is just one <code>N</code></p>



<a name="166716186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716186">(May 28 2019 at 13:25)</a>:</h4>
<p>whereas if you wrote <code>fn foo(const N: usize, x: [u8; N])</code> then you'd be forced to write <code>foo(0, [])</code></p>



<a name="166716196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716196">(May 28 2019 at 13:25)</a>:</h4>
<p>at least assuming the implicit/explicit distinction</p>



<a name="166716259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716259">(May 28 2019 at 13:26)</a>:</h4>
<p>we have <em>three</em> systems that came up in this discussion: typenum, const generics, const fn arguments. typenum needs inference to avoid repetition.</p>



<a name="166716273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716273">(May 28 2019 at 13:26)</a>:</h4>
<p>typenum needs to go away <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="166716281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716281">(May 28 2019 at 13:26)</a>:</h4>
<p>but what replaces it shouldn't be worse</p>



<a name="166716289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716289">(May 28 2019 at 13:26)</a>:</h4>
<p>worse? huh...</p>



<a name="166716312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716312">(May 28 2019 at 13:27)</a>:</h4>
<p>const generics can sometimes be inferred like when the value <em>also</em> occurs in a type. but the cases we are talking  about are such that that's not possible (I thought)</p>



<a name="166716313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716313">(May 28 2019 at 13:27)</a>:</h4>
<p>how can const generics be worse than singleton hacks to fake dependent types</p>



<a name="166716354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716354">(May 28 2019 at 13:27)</a>:</h4>
<p>by forcing people to write <code>foo::&lt;{....}&gt;()</code> vs just <code>foo(...)</code></p>



<a name="166716470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716470">(May 28 2019 at 13:28)</a>:</h4>
<p>so <span class="user-mention" data-user-id="126931">@centril</span> please stop with your inference stuff because I dont think that applies here :) like in <span class="user-mention" data-user-id="132920">@gnzlbg</span>'s <code>foo(N, run_time_val)</code>, there is no inferring <code>N</code>.</p>



<a name="166716486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716486">(May 28 2019 at 13:28)</a>:</h4>
<p>i consider having to change a function from <code>fn foo(x: i32)</code> callable as <code>foo(x)</code> to <code>fn foo&lt;const x: i32&gt;()</code> callable as <code>foo::&lt;{x}&gt;()</code> a regression - if the only intent is to encode in the type that <code>x</code> must be a <code>const</code></p>



<a name="166716529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716529">(May 28 2019 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I'm so confused now... :P</p>



<a name="166716560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716560">(May 28 2019 at 13:29)</a>:</h4>
<p>also I should get some work done, maybe you two can deconfuse yourselves easier without me being around :) ttyl</p>



<a name="166716693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716693">(May 28 2019 at 13:30)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  In the cases where you'd need to write <code>foo::&lt;{ ... }&gt;()</code> with const generics you'd presumably have to write <code>fn foo::&lt;{ ... }&gt;</code> to write out the singleton type in any case</p>



<a name="166716726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716726">(May 28 2019 at 13:30)</a>:</h4>
<p>well no if the code was using typenum</p>



<a name="166716741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716741">(May 28 2019 at 13:30)</a>:</h4>
<p>because the singleton type cannot be inferred unless constrained by a type</p>



<a name="166716769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716769">(May 28 2019 at 13:31)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> what sort of magic does typenum have :D</p>



<a name="166716834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716834">(May 28 2019 at 13:31)</a>:</h4>
<p><code>fn foo&lt;T&gt;(x: T); foo(one: One);</code></p>



<a name="166716922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716922">(May 28 2019 at 13:32)</a>:</h4>
<p>you need to write out the ZST expression there</p>



<a name="166716932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716932">(May 28 2019 at 13:32)</a>:</h4>
<p>how is that ergonomic?</p>



<a name="166716970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716970">(May 28 2019 at 13:33)</a>:</h4>
<p>i don't have to write <code>foo::&lt;One&gt;()</code>, I find writing <code>foo(one)</code> better</p>



<a name="166716994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166716994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166716994">(May 28 2019 at 13:33)</a>:</h4>
<p>I'm having the feeling that you all prefer <code>foo::&lt;{one}&gt;()</code> better than <code>foo(one)</code></p>



<a name="166717023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717023">(May 28 2019 at 13:33)</a>:</h4>
<p>No not really</p>



<a name="166717030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717030">(May 28 2019 at 13:33)</a>:</h4>
<p>I think it's a minor papercut</p>



<a name="166717136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717136">(May 28 2019 at 13:34)</a>:</h4>
<p>I do find <code>foo::&lt;1&gt;()</code> nicer tho</p>



<a name="166717148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717148">(May 28 2019 at 13:34)</a>:</h4>
<p>1 vs. One</p>



<a name="166717176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717176">(May 28 2019 at 13:35)</a>:</h4>
<p>tbh given the effort put trying to slay the turbofish i don't think this is a minor papercut :P</p>



<a name="166717207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717207">(May 28 2019 at 13:35)</a>:</h4>
<p>as a user, having to remember which argument is a const generic and which one isn't isn't minor</p>



<a name="166717211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717211">(May 28 2019 at 13:35)</a>:</h4>
<p><span class="user-mention" data-user-id="125254">@kennytm</span> that's mostly a matter of consistency <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="166717241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717241">(May 28 2019 at 13:35)</a>:</h4>
<p>like if I call foo(x, y, z) and <code>y</code> needs to be a const, I  probably get a really good error message with <code>foo(x: i32, const y: i32, z: i32)</code></p>



<a name="166717312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717312">(May 28 2019 at 13:36)</a>:</h4>
<p>but if I have <code>foo::&lt;const Y: usize&gt;(x: i32, z: i32)</code> instead, the error message might be weird</p>



<a name="166717314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717314">(May 28 2019 at 13:36)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> I'm in favor of <code>(const A: B)</code> where <code>A</code> must be provided explicitly, so it seems we are agreed practically speaking?</p>



<a name="166717357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717357">(May 28 2019 at 13:36)</a>:</h4>
<blockquote>
<p>the error message might be weird</p>
</blockquote>
<p>Let's reserve judgement until <span class="user-mention" data-user-id="119031">@Esteban Küber</span> has worked is magic shall we?</p>



<a name="166717404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717404">(May 28 2019 at 13:37)</a>:</h4>
<p>the number of arguments doesn't match, a single type parameter is missing or can't be deduced, ...</p>



<a name="166717430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717430">(May 28 2019 at 13:37)</a>:</h4>
<p>the best error message that I can imagine for this function would still be worse than "y is not a <code>const</code> but should be"</p>



<a name="166717633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717633">(May 28 2019 at 13:39)</a>:</h4>
<p>if we have this, can we declare this to be just syntactic sugar? so that later phases of the compiler dont even have to know about this any more?</p>



<a name="166717781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717781">(May 28 2019 at 13:40)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> the main problem with making this just syntax sugar, is that we'd need to translate <code>fn foo(const X: i32)</code> to <code>fn foo&lt;const X: i32&gt;()</code> at some point</p>



<a name="166717835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717835">(May 28 2019 at 13:41)</a>:</h4>
<p>and then the question about how this mapping works needs to be resolved</p>



<a name="166717851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717851">(May 28 2019 at 13:41)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="125254">kennytm</span> that's mostly a matter of consistency :)</p>
</blockquote>
<p>i suppose the issue at hand is <code>_mm_shuffle_pd::&lt;0b10&gt;(x, y)</code>, if so written, is inconsistent with other SIMD APIs</p>



<a name="166717983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166717983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166717983">(May 28 2019 at 13:42)</a>:</h4>
<p><code>fn foo&lt;'a, T&gt;(const X: usize)</code> =&gt; <code>fn foo&lt;const X: usize, 'a, T&gt;()</code>, <code>fn foo&lt;'a, const X: usize, T&gt;</code>, etc.</p>



<a name="166718210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718210">(May 28 2019 at 13:44)</a>:</h4>
<p><span class="user-mention" data-user-id="125254">@kennytm</span> the desugared syntax needs to map to const generic syntax, so we need to put "const function arguments" somewhere in the type list</p>



<a name="166718213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718213">(May 28 2019 at 13:44)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  where the mapped parameter is placed should be internal to the compiler and irrelevant to the API user</p>



<a name="166718259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718259">(May 28 2019 at 13:45)</a>:</h4>
<p>i thought it would impact name mangling, etc.</p>



<a name="166718265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718265">(May 28 2019 at 13:45)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> it doesnt have to be a desugaring that is literally concerned with restrictions such as this list of parameters</p>



<a name="166718279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718279">(May 28 2019 at 13:45)</a>:</h4>
<p>but it could be conceptual</p>



<a name="166718311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718311">(May 28 2019 at 13:45)</a>:</h4>
<p>just have a 2nd invisible list that these desugared things are added to, or so</p>



<a name="166718314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718314">(May 28 2019 at 13:46)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> it's ok as long as the mangling is internally consistent?</p>



<a name="166718374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718374">(May 28 2019 at 13:46)</a>:</h4>
<p>and for mangling imagine that list to be at the end</p>



<a name="166718377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718377">(May 28 2019 at 13:46)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> so i also would want this to just be desugaring</p>



<a name="166718410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718410">(May 28 2019 at 13:46)</a>:</h4>
<p>or just literally just have it at the end, and lift the restrictions we usually have about only giving none or all of the implicit arguments such that the desugared case where only the "const fn arg" parts are filled is okay</p>



<a name="166718446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718446">(May 28 2019 at 13:46)</a>:</h4>
<p>i think it should have the same treatment as APIT regarding mangling</p>



<a name="166718488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166718488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166718488">(May 28 2019 at 13:47)</a>:</h4>
<p>that makes sense</p>



<a name="166727284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166727284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166727284">(May 28 2019 at 15:25)</a>:</h4>
<p>const parameters must currently come last anyway, so there's a canonical choice of desugaring</p>



<a name="166727324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166727324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166727324">(May 28 2019 at 15:25)</a>:</h4>
<p>(though that may not always be true)</p>



<a name="166727609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/166727609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#166727609">(May 28 2019 at 15:28)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span>  s/first/last ?</p>



<a name="167168820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/167168820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#167168820">(Jun 03 2019 at 08:59)</a>:</h4>
<p>Good morning!</p>



<a name="167169593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/167169593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#167169593">(Jun 03 2019 at 09:11)</a>:</h4>
<p>I'm all for having a mean to put constants as normal arguments :)</p>



<a name="167169634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc_args_required_const%20in%20traits/near/167169634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc_args_required_const.20in.20traits.html#167169634">(Jun 03 2019 at 09:12)</a>:</h4>
<p><code>vec_splat_u8::&lt;15&gt;()</code> is _quite_ a lot of noise</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>